﻿using System;
using System.Collections.Generic;

namespace DbMetadata
{
    /// <summary>
    /// Provides metadata information about a foreign key.
    /// </summary>
    [Serializable]
    public class DbForeignKeyInfo : DbKeyInfo
    {
        private readonly IList<DbForeignKeyColumnInfo>
            _foreignKeyColumns = new List<DbForeignKeyColumnInfo>();

        /// <summary>
        /// Gets a list of <see cref="DbForeignKeyColumnInfo"/> instances that represents this foreign key.
        /// </summary>
        public IList<DbForeignKeyColumnInfo> ForeignKeyColumns
        {
            get { return _foreignKeyColumns; }
        }

        /// <summary>
        /// Gets the <see cref="DbTableInfo"/> instance that represents the primary table 
        /// for this foreign key.
        /// </summary>
        public DbTableInfo PrimaryTable { get; set; }
    }
}
